package poly_;

public class Master {
    private String name;

    public Master(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //使用多态机制，可以统一管理主人喂食物的问题
    public void feed(Animal a, Food f)
    {
        System.out.println("主人" + name + "给" + a.getName() + "喂了" + f.getName());
    }
}
